<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>fdk-aac: original/libSBRenc/src/resampler.cpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">fdk-aac
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_ed137715e08969a186ec660e8ae6e2fb.html">original</a></li><li class="navelem"><a class="el" href="dir_ed04b364c633b7d989cbbfdbe7d82d9c.html">libSBRenc</a></li><li class="navelem"><a class="el" href="dir_503efe22260b46e9073f09b8bee50978.html">src</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">resampler.cpp File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>FDK resampler tool box:  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;<a class="el" href="resampler_8h_source.html">resampler.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="generic_stds_8h_source.html">genericStds.h</a>&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_f_i_l_t_e_r___p_a_r_a_m.html">FILTER_PARAM</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a7b21d6a6a4573b4997b1f04b01cd4efb"><td class="memItemLeft" align="right" valign="top"><a id="a7b21d6a6a4573b4997b1f04b01cd4efb"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>B1</b>&#160;&#160;&#160;0</td></tr>
<tr class="separator:a7b21d6a6a4573b4997b1f04b01cd4efb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6945d50f798e1fde624d70c74457090e"><td class="memItemLeft" align="right" valign="top"><a id="a6945d50f798e1fde624d70c74457090e"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>B2</b>&#160;&#160;&#160;1</td></tr>
<tr class="separator:a6945d50f798e1fde624d70c74457090e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acd92b430059d886880c53f13ae038e3f"><td class="memItemLeft" align="right" valign="top"><a id="acd92b430059d886880c53f13ae038e3f"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>A1</b>&#160;&#160;&#160;2</td></tr>
<tr class="separator:acd92b430059d886880c53f13ae038e3f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2946bc30423c2a996eeafa49e995c30e"><td class="memItemLeft" align="right" valign="top"><a id="a2946bc30423c2a996eeafa49e995c30e"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>A2</b>&#160;&#160;&#160;3</td></tr>
<tr class="separator:a2946bc30423c2a996eeafa49e995c30e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2918a1048c66c23e9585d96e52c55cbd"><td class="memItemLeft" align="right" valign="top"><a id="a2918a1048c66c23e9585d96e52c55cbd"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>BQC</b>(x)&#160;&#160;&#160;FL2FXCONST_SGL(x / 2)</td></tr>
<tr class="separator:a2918a1048c66c23e9585d96e52c55cbd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9c7ec1d47a50f988e6f55e9d2b1300f8"><td class="memItemLeft" align="right" valign="top"><a id="a9c7ec1d47a50f988e6f55e9d2b1300f8"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>BIQUAD_COEFSTEP</b>&#160;&#160;&#160;4</td></tr>
<tr class="separator:a9c7ec1d47a50f988e6f55e9d2b1300f8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab7910c4e2e0d29168f3d17b2ea1b2893"><td class="memItemLeft" align="right" valign="top"><a id="ab7910c4e2e0d29168f3d17b2ea1b2893"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>BIQUAD_SCALE</b>&#160;&#160;&#160;12</td></tr>
<tr class="separator:ab7910c4e2e0d29168f3d17b2ea1b2893"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ae52a7b5a008d1393eb77983b96a708cb"><td class="memItemLeft" align="right" valign="top"><a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resampler_8cpp.html#ae52a7b5a008d1393eb77983b96a708cb">FDKaacEnc_InitDownsampler</a> (<a class="el" href="struct_d_o_w_n_s_a_m_p_l_e_r.html">DOWNSAMPLER</a> *DownSampler, int Wc, int ratio)</td></tr>
<tr class="memdesc:ae52a7b5a008d1393eb77983b96a708cb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reset downsampler instance and clear delay lines.  <a href="resampler_8cpp.html#ae52a7b5a008d1393eb77983b96a708cb">More...</a><br /></td></tr>
<tr class="separator:ae52a7b5a008d1393eb77983b96a708cb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a006e883284c837abd5f0f8c853acaed4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resampler_8cpp.html#a006e883284c837abd5f0f8c853acaed4">FDKaacEnc_Downsample</a> (<a class="el" href="struct_d_o_w_n_s_a_m_p_l_e_r.html">DOWNSAMPLER</a> *DownSampler, <a class="el" href="machine__type_8h.html#ac024ad9a1e48a3e87d360d519d943512">INT_PCM</a> *inSamples, <a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a> numInSamples, <a class="el" href="machine__type_8h.html#ac024ad9a1e48a3e87d360d519d943512">INT_PCM</a> *outSamples, <a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a> *numOutSamples)</td></tr>
<tr class="memdesc:a006e883284c837abd5f0f8c853acaed4"><td class="mdescLeft">&#160;</td><td class="mdescRight">FDKaacEnc_Downsample numInSamples of type INT_PCM Returns number of output samples in numOutSamples.  <a href="resampler_8cpp.html#a006e883284c837abd5f0f8c853acaed4">More...</a><br /></td></tr>
<tr class="separator:a006e883284c837abd5f0f8c853acaed4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>FDK resampler tool box: </p>
<dl class="section rcs"><dt>Revision</dt><dd>91655 </dd></dl>
<dl class="section author"><dt>Author</dt><dd>M. Werner </dd></dl>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="a006e883284c837abd5f0f8c853acaed4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a006e883284c837abd5f0f8c853acaed4">&#9670;&nbsp;</a></span>FDKaacEnc_Downsample()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a> FDKaacEnc_Downsample </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_d_o_w_n_s_a_m_p_l_e_r.html">DOWNSAMPLER</a> *&#160;</td>
          <td class="paramname"><em>DownSampler</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="machine__type_8h.html#ac024ad9a1e48a3e87d360d519d943512">INT_PCM</a> *&#160;</td>
          <td class="paramname"><em>inSamples</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a>&#160;</td>
          <td class="paramname"><em>numInSamples</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="machine__type_8h.html#ac024ad9a1e48a3e87d360d519d943512">INT_PCM</a> *&#160;</td>
          <td class="paramname"><em>outSamples</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a> *&#160;</td>
          <td class="paramname"><em>numOutSamples</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>FDKaacEnc_Downsample numInSamples of type INT_PCM Returns number of output samples in numOutSamples. </p>
<p>Downsample a set of audio samples. numInSamples must be at least equal to the downsampler ratio.</p>
<dl class="section return"><dt>Returns</dt><dd>success of operation </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">DownSampler</td><td>pointer to downsampler instance </td></tr>
    <tr><td class="paramname">inSamples</td><td>pointer to input samples </td></tr>
    <tr><td class="paramname">numInSamples</td><td>number of input samples </td></tr>
    <tr><td class="paramname">outSamples</td><td>pointer to output samples </td></tr>
    <tr><td class="paramname">numOutSamples</td><td>pointer tp number of output samples </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ae52a7b5a008d1393eb77983b96a708cb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae52a7b5a008d1393eb77983b96a708cb">&#9670;&nbsp;</a></span>FDKaacEnc_InitDownsampler()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a> FDKaacEnc_InitDownsampler </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_d_o_w_n_s_a_m_p_l_e_r.html">DOWNSAMPLER</a> *&#160;</td>
          <td class="paramname"><em>DownSampler</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>Wc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>ratio</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Reset downsampler instance and clear delay lines. </p>
<dl class="section return"><dt>Returns</dt><dd>success of operation </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">DownSampler</td><td>pointer to downsampler instance </td></tr>
    <tr><td class="paramname">Wc</td><td>normalized cutoff freq * 1000* </td></tr>
    <tr><td class="paramname">ratio</td><td>downsampler ratio </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
</small></address>
</body>
</html>
